#import "PolicyWebViewController.h"
#import <WebKit/WebKit.h>

@interface PolicyWebViewController () <WKNavigationDelegate>

@property (nonatomic, strong) WKWebView *webView;
@property (nonatomic, copy) NSString *relativePath;

@end

@implementation PolicyWebViewController

- (instancetype)initWithRelativePath:(NSString *)relativePath
{
    self = [super init];
    if (self) {
        _relativePath = [relativePath copy];
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor whiteColor];

    WKWebView *web = [[WKWebView alloc] initWithFrame:self.view.bounds];
    web.scrollView.bounces = NO;
    web.scrollView.showsVerticalScrollIndicator = NO;
    web.scrollView.showsHorizontalScrollIndicator = NO;
    [self.view addSubview:web];
    self.webView = web;
    
    [web loadRequest:[NSMutableURLRequest requestWithURL:[NSURL URLWithString:_relativePath]]];
}

@end


